package com.rivulet.doj_backend.depend;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
public class RestResponse {
    private int code;
    private String message;

    public RestResponse() {
        this.code = 0;
        this.message = "";
    }

    public RestResponse(int code) {
        this.code = 0;
        this.message = "";
        this.code = code;
    }

    public RestResponse(int code, String message) {
        this(code);
        this.message = message;
    }

    public int getCode() {
        return this.code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return this.message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String toString() {
        return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
    }

    public boolean isSuccess() {
        return this.code == 0;
    }
}